package com.vo;

import java.io.Serializable;
import java.text.SimpleDateFormat;

/**
 * View Object实体: 供应商
 */
public class Provider implements Serializable {
    /** 供应商id */
    private String id;
    /** 供应商编号 */
    private String idName;
    /** 供应商名称 */
    private String providerName;
    /** 供应商联系人 */
    private String phoneName;
    /** 供应商电话 */
    private String phone;
    /** 供应商传真 */
    private String fax;
    /** 供应商日期 */
    private String date;

    public com.bean.Provider parse(){

        com.bean.Provider provider = new com.bean.Provider();

        try {
            provider.setId(Integer.valueOf(this.id));
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            provider.setDate(new SimpleDateFormat("yyyy-MM-dd").parse(this.date));
        } catch (Exception e) {
            e.printStackTrace();
        }
        provider.setPhone(this.phone);
        provider.setFax(this.fax);
        provider.setIdName(this.idName);
        provider.setProviderName(this.providerName);
        provider.setPhoneName(this.phoneName);

        return provider;
    }

    @Override
    public String toString() {
        return "Provider{" +
                "id='" + id + '\'' +
                ", idName='" + idName + '\'' +
                ", providerName='" + providerName + '\'' +
                ", phoneName='" + phoneName + '\'' +
                ", phone='" + phone + '\'' +
                ", fax='" + fax + '\'' +
                ", date='" + date + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIdName() {
        return idName;
    }

    public void setIdName(String idName) {
        this.idName = idName;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    public String getPhoneName() {
        return phoneName;
    }

    public void setPhoneName(String phoneName) {
        this.phoneName = phoneName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }
}
